#ifndef SAMPLER_HH_
#define SAMPLER_HH_

#include <vector>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_01.hpp>
#include <numeric>
#include "util.hh"

struct sampler_t
{
  typedef std::vector<double> vec_t;

  explicit sampler_t() :
      RandGen(time(0)), unif()
  {
  }

  explicit sampler_t(int seed) :
      RandGen(seed), unif()
  {
  }

  virtual ~sampler_t()
  {
  }

  int operator()(const vec_t& prob);

  int sample(const vec_t& prob);

  int log_sample(const vec_t& lprob);

private:
  boost::random::mt19937 RandGen;
  boost::random::uniform_01<double> unif;
};


#endif /* SAMPLER_HH_ */
